Class IPHeaderImpl

All Implemented Interfaces:
IPCData, Header, IPHeader, Pdu, Signal

public class IPHeaderImpl extends HeaderImpl implements IPHeader
  • Field Details

    • version

      protected Byte version
    • headerLength

      protected Byte headerLength
    • typeOfService

      protected Byte typeOfService
    • totalLength

      protected Short totalLength
    • identification

      protected Short identification
    • flags

      protected Byte flags
    • fragmentOffset

      protected Short fragmentOffset
    • ttl

      protected Short ttl
    • protocol

      protected Short protocol
    • checksum

      protected Short checksum
    • srcAddress

      protected IPAddress srcAddress
    • dstAddress

      protected IPAddress dstAddress
    • options

      protected int options
    • padding

      protected int padding
  • Constructor Details

    • IPHeaderImpl

      public IPHeaderImpl()
  • Method Details

    • getVersion

      public Byte getVersion()
      Specified by:
      getVersion in interface IPHeader
      Returns:
      Byte Returns a Byte
    • setVersion

      public void setVersion(Byte version)
      Specified by:
      setVersion in interface IPHeader
      Parameters:
      version - Takes in a parameter of version
    • getHeaderLength

      public Byte getHeaderLength()
      Specified by:
      getHeaderLength in interface IPHeader
      Returns:
      Byte Returns a Byte
    • setHeaderLength

      public void setHeaderLength(Byte headerLength)
      Specified by:
      setHeaderLength in interface IPHeader
      Parameters:
      headerLength - Takes in a parameter of headerLength
    • getTypeOfService

      public Byte getTypeOfService()
      Specified by:
      getTypeOfService in interface IPHeader
      Returns:
      Byte Returns a Byte
    • setTypeOfService

      public void setTypeOfService(Byte typeOfService)
      Specified by:
      setTypeOfService in interface IPHeader
      Parameters:
      typeOfService - Takes in a parameter of typeOfService
    • getTotalLength

      public Short getTotalLength()
      Specified by:
      getTotalLength in interface IPHeader
      Returns:
      Short Returns a Short
    • setTotalLength

      public void setTotalLength(Short totalLength)
      Specified by:
      setTotalLength in interface IPHeader
      Parameters:
      totalLength - Takes in a parameter of totalLength
    • getIdentification

      public Short getIdentification()
      Specified by:
      getIdentification in interface IPHeader
      Returns:
      Short Returns a Short
    • setIdentification

      public void setIdentification(Short identification)
      Specified by:
      setIdentification in interface IPHeader
      Parameters:
      identification - Takes in a parameter of identification
    • getFlags

      public Byte getFlags()
      Specified by:
      getFlags in interface IPHeader
      Returns:
      Byte Returns a Byte
    • setFlags

      public void setFlags(Byte flags)
      Specified by:
      setFlags in interface IPHeader
      Parameters:
      flags - Takes in a parameter of flags
    • getFragmentOffset

      public Short getFragmentOffset()
      Specified by:
      getFragmentOffset in interface IPHeader
      Returns:
      Short Returns a Short
    • setFragmentOffset

      public void setFragmentOffset(Short fragmentOffset)
      Specified by:
      setFragmentOffset in interface IPHeader
      Parameters:
      fragmentOffset - Takes in a parameter of fragmentOffset
    • getTtl

      public Short getTtl()
      Specified by:
      getTtl in interface IPHeader
      Returns:
      Short Returns a Short
    • setTtl

      public void setTtl(Short ttl)
      Specified by:
      setTtl in interface IPHeader
      Parameters:
      ttl - Takes in a parameter of ttl
    • getProtocol

      public Short getProtocol()
      Specified by:
      getProtocol in interface IPHeader
      Returns:
      Short Returns a Short
    • setProtocol

      public void setProtocol(Short protocol)
      Specified by:
      setProtocol in interface IPHeader
      Parameters:
      protocol - Takes in a parameter of protocol
    • getChecksum

      public Short getChecksum()
      Specified by:
      getChecksum in interface IPHeader
      Returns:
      Short Returns a Short
    • setChecksum

      public void setChecksum(Short checksum)
      Specified by:
      setChecksum in interface IPHeader
      Parameters:
      checksum - Takes in a parameter of checksum
    • getSrcAddress

      public IPAddress getSrcAddress()
      Specified by:
      getSrcAddress in interface IPHeader
      Returns:
      IPAddress Returns a IPAddress
    • setSrcAddress

      public void setSrcAddress(IPAddress srcAddress)
      Specified by:
      setSrcAddress in interface IPHeader
      Parameters:
      srcAddress - Takes in a parameter of srcAddress
    • getDstAddress

      public IPAddress getDstAddress()
      Specified by:
      getDstAddress in interface IPHeader
      Returns:
      IPAddress Returns a IPAddress
    • setDstAddress

      public void setDstAddress(IPAddress dstAddress)
      Specified by:
      setDstAddress in interface IPHeader
      Parameters:
      dstAddress - Takes in a parameter of dstAddress
    • getOptions

      public int getOptions()
      Specified by:
      getOptions in interface IPHeader
      Returns:
      int Returns a int
    • setOptions

      public void setOptions(int options)
      Specified by:
      setOptions in interface IPHeader
      Parameters:
      options - Takes in a parameter of options
    • getPadding

      public int getPadding()
      Specified by:
      getPadding in interface IPHeader
      Returns:
      int Returns a int
    • setPadding

      public void setPadding(int padding)
      Specified by:
      setPadding in interface IPHeader
      Parameters:
      padding - Takes in a parameter of padding
    • getFieldType

      public PtmpTypeValue getFieldType(String fieldName)
      Overrides:
      getFieldType in class HeaderImpl
    • read

      public void read(EncodedBuffer buffer)
      Reads this object from an EncodedBuffer of raw data
      Specified by:
      read in interface IPCData
      Overrides:
      read in class HeaderImpl
      Parameters:
      buffer - The EncodedBuffer that contains the raw data from which to construct this object
    • pduRead

      public void pduRead(EncodedBuffer buffer)
      Specified by:
      pduRead in interface Signal
      Overrides:
      pduRead in class HeaderImpl
    • getOrderedFieldNames

      public List<String> getOrderedFieldNames()
      Specified by:
      getOrderedFieldNames in interface Signal
      Overrides:
      getOrderedFieldNames in class HeaderImpl
    • encodeTypeAndPayload

      public void encodeTypeAndPayload(EncodedBuffer buffer)
      Specified by:
      encodeTypeAndPayload in interface Signal
      Overrides:
      encodeTypeAndPayload in class HeaderImpl